<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        for (var i = 100; i <= 999; i++) {
            var gewei = i % 10;
            var shiwei = parseInt(i / 10) % 10;
            var baiwei = parseInt(i / 100);
            var total = Math.pow(gewei, 3) + Math.pow(shiwei, 3) + Math.pow(baiwei, 3)
            if (total == i) {
                console.log(i);

            }
        }
    </script>
</body>

</html>